﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Project.Core.Common
{
    public class PageInfo
    {
        private int _pageIndex = 1;
        private int _pageSize = 20;

        public PageInfo(int pageIndex = 1, int pageSize = 20)
        {
            _pageIndex = pageIndex;
            _pageSize = pageSize;
        }

        public int PageIndex
        {
            get
            {
                if (_pageIndex < 1)
                {
                    _pageIndex = 1;
                }
                return _pageIndex;
            }
            set
            {
                _pageIndex = value;
            }
        }

        public int PageSize
        {
            get
            {
                if (_pageSize < 1)
                {
                    _pageSize = 20;
                }
                return _pageSize;
            }
            set
            {
                _pageSize = value;
            }
        }

    }
}
